package com.chapter13;

public class Line {

	int Mnum;
	int Mden;
	int Cnum;
	int Cden;
	
	public boolean equals(Object o) {
	    if (o instanceof Line) {
	      Line other = (Line) o;
	      return (Mnum/(double)Mden == other.Mnum/(double)other.Mden && Cnum/(double)Cden == other.Cnum/(double)other.Cden);
	    }
	    return false;
	 }
	
	public int hashCode(){
		return Mnum*31^4+Mden*31^3+Cnum*31^2+Cden*31;
	}
}
